/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package list;

/**
 *
 * @author ericzhou
 */
public abstract class MyAbstractList implements MyList {
    protected int size=0;
    
    protected MyAbstractList(){
    }
    
    protected MyAbstractList(Object[] objects){
        for (int i=0; i<objects.length; i++){
            this.add(objects[1]);
        }
    }
    
    public void add(Object o){
        add(size, o);
    }
    
    public boolean isEmpty(){
        return size==0;
    }
    
    public int size(){
        return size;
    }
    
    public boolean remove(Object o){
        if (indexOf(o)>=0){
            remove(indexOf(o));
            return true;
        }else 
            return false;
    }
}
